Skip to content

Conversation

@Sonicadvance1
Copy link
Member

@Sonicadvance1 Sonicadvance1 commented Dec 22, 2025

Audits the direct uses of LoadConstant for padding requirements.
Two things:

  • ThreadRemoveCodeEntry uses the block entry but relocations aren't wired up to it. This will break under codecaching
  • Constant IR op needs to be audited through the OpcodeDispatcher, with padding data passed through from the dispatcher.

This should reduce a significant amount of padding from happening in the JIT with code caching enabled, even with this first pass. I'll be walking through the OpcodeDispatcher for their use of padding required constants and working on passing that information through to the backend.

`Constant` IR op needs the frontend to be audited and pass padding
information through.
`ThreadRemoveCodeEntry` doesn't properly have relations wired up but it
does use the Entry. So this would be broken on code caching with
relocations.
All direct usages have been audited. Now we need to do indirect usages
through the `Constant` IR operation.
@bylaws
Copy link
Collaborator

bylaws commented Dec 29, 2025

I feel that NOPAD should really be a default arg here, the cases where padding is required are purely relocations which are special anyway and one would be aware if padding were necessary when writing such code. It adds a lot of noise otherwise

@Sonicadvance1
Copy link
Member Author

I feel that NOPAD should really be a default arg here, the cases where padding is required are purely relocations which are special anyway and one would be aware if padding were necessary when writing such code. It adds a lot of noise otherwise

I'll do that as a post-merge change. I want to ensure that if code-caching needs to get bisected through this that it doesn't break.

@Sonicadvance1 Sonicadvance1 merged commit 5bbbe4d into FEX-Emu:main Dec 29, 2025
13 checks passed
@Sonicadvance1 Sonicadvance1 deleted the 25 branch December 29, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants